import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Test {

    public static void main1(String[] args) {

        BigDecimal a1 = BigDecimal.valueOf(0.1);
        BigDecimal a2 = BigDecimal.valueOf(0.3);




        BigDecimal a3 = a1.divide(a2, 2, RoundingMode.HALF_UP  );
        System.out.println(a3);
        double d = a3.doubleValue();
        System.out.println(d);
    }

    public static void main2(String[] args) {

        Date d = new Date();
        System.out.println(d);

        long t = d.getTime();
        System.out.println(t);

        t += 2 * 1000;
        Date d2 = new Date(t);
        System.out.println(d2);

        Date d3 = new Date();
        d3.setTime(t);
        System.out.println(d3);
    }

    public static void main3(String[] args) {

        Date d = new Date();
        System.out.println(d);

        long t = d.getTime();
        System.out.println(t);

        t += 3 * 10000;

        Date d2 = new Date(t);
        System.out.println(d2);

        Date d3 = new Date();
        d3.setTime(t);
        System.out.println(d3);
    }

    public static void main11(String[] args) {

        Date d = new Date();
        System.out.println(d);

        long t = d.getTime();
        System.out.println(t);

        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss EEE a");
        String s2 = s.format(d);
        System.out.println(s2);
        String s3 = s.format(t);
        System.out.println(s3);
    }

    public static void main22(String[] args) throws ParseException {

        Date d = new Date();
        System.out.println(d);

        long t = d.getTime();
        System.out.println(t);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss EEE a");
        String s = sdf.format(d);
        System.out.println(s);
        String s1 = sdf.format(t);
        System.out.println(s1);

        System.out.println("--------------");

        String s2 = "2022-12-12 12:12:11";
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = sdf2.parse(s2);
        System.out.println(date);
    }

    public static void main33(String[] args) throws ParseException {

        String s = "3232-1-30 21:34:41";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date d = sdf.parse(s);
        System.out.println(d);
        Date date = new Date();
        String s1 = sdf.format(date);
        System.out.println(s1);
    }

    public static void main(String[] args) {


        Calendar now = Calendar.getInstance();
        System.out.println(now);
    }
}
